var amqp = require('amqp');
var connOptions = {
    host: "172.16.200.105",
    port: 5672,
    login: "root",
    password: "tuandai_bm2015",
    vhost: "/"
}
var conn = amqp.createConnection(connOptions); //连接rabbitmq

conn.on("ready", function() {
    var exchange = conn.exchange('test', { type: 'fanout', durable: true, autoDelete: false });
    exchange.publish('#', 'hello world', function(a) {
        console.log(a);
    });
});